home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
ICNDRW_1.ARJ
/
DRAGICON.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-08-20
|
3KB
|
101 lines
{---------------------------------------------------------------------
Drag Icon
Copyright (c) 1991 - SofDesign Technology
All Rights Reserved
This program demostrates the icon drag feature.
To use, type
DRAGICON libname iconname
if libname is not specified, then an icon name is assumed.
note: you must use the file extensions on the libname and
the iconname.
---------------------------------------------------------------------}
program Drag_Icon;
{$X+}
{$G+}
{$R-}
{$S-}
uses crt,mouse,bgidriv,graph,icontool;
var
graphdriver,graphmode : integer;
anicon:icon;
procedure main;
var i:integer;
mx,my,b:word;
k:char;
showtitle:boolean;
begin
if paramcount=1 then
anicon.init('',paramstr(1),20,20)
else
if paramcount>1 then
anicon.init(paramstr(1),paramstr(2),20,20);
if not anicon.initerror then
begin
showtitle:=false;
rectangle(0,10,getmaxx,getmaxy-10);
setfillstyle(solidfill,getmaxcolor);
bar((getmaxx div 2)-100,getmaxy div 2 - 10,getmaxx div 2 + 100,getmaxy div 2 + 10);
outtextxy(1,1,'ICON DRAG. Left Button picks icon up, Right Button or ''Q'' quits');
outtextxy(1,getmaxy-9,'Copyright (c) 1991 - SofDesign Technology - All Rights Reserved');
anicon.setput(copyput);
anicon.icontitle(showtitle);
anicon.showicon;
anicon.setboundaries(1,10,getmaxx-1,getmaxy-10);
driverinstalled;
resetmouse;
setmouse(getmaxx div 2, getmaxy div 2);
showmouse;
repeat
getmouse(mx,my,b);
if keypressed then
begin
k:=upcase(readkey);
if k='T' then
begin
hidemouse;
anicon.hideicon;
showtitle:=not showtitle;
anicon.icontitle(showtitle);
anicon.showicon;
showmouse;
end;
end;
if anicon.inbounds(mx,my) then
begin
if b=1 then
begin
anicon.setput(orput);
anicon.mousedragicon(1);
hidemouse;
anicon.hideicon;
anicon.setput(copyput);
anicon.showicon;
showmouse;
end;
end;
until (k='Q') or (b=2);
hidemouse;
end;
closegraph;
end;
begin
RegisterBGIdriver(@CGADriverProc);
RegisterBGIdriver(@EGAVGADriverProc);
RegisterBGIdriver(@HercDriverProc);
RegisterBGIdriver(@ATTDriverProc);
RegisterBGIdriver(@PC3270DriverProc);
detectgraph(graphdriver,graphmode);
initgraph(graphdriver,graphmode,'');
main;
end.